/**
 * @param {string[]} logs
 * @return {number}
 */
var minOperations = function(logs) {
  let count = 0;
  for(let i = 0; i < logs.length; i++) {
    if(logs[i] == './') {
      continue;
    } else if(logs[i] == '../') {
      if(count == 0) continue;
      count--;
    } else {
      count++;
    }
  }
  return count < 0 ? 0 : count;
};
let logs = ["d1/","d2/","../","d21/","./"];
console.log(minOperations(logs));
logs = ["d1/","d2/","./","d3/","../","d31/"];
console.log(minOperations(logs));
logs = ["d1/","../","../","../"];
console.log(minOperations(logs));
logs = ["./","wz4/","../","mj2/","../","../","ik0/","il7/"];
console.log(minOperations(logs));
